﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.Master" AutoEventWireup="true" CodeBehind="frm_Asignacion.aspx.cs" Inherits="ED_Nivelacion.PresentacionWeb.Asignacion" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .auto-style1
        {
            width: 358px;
        }
        .auto-style2
        {
            font-size: large;
        }
        .auto-style3
        {
            padding: 10px 15px;
            border-bottom: 1px solid transparent;
            border-top-left-radius: 3px;
            border-top-right-radius: 3px;
            font-size: large;
        }
        .auto-style4
        {
            width: 348px;
        }
        .auto-style5
        {
            width: 315px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script>
        $(document).ready(function () {

            $('#ContentPlaceHolder1_Cbm_Periodo').attr('onchange', "Consultar()");
            $('#ContentPlaceHolder1_cbm_Carreras').attr('onchange', "Consultar()");
            
              
           
           


        });


        function Consultar() {

            $('#ContentPlaceHolder1_cbmParalelo').html("");
            
            var periodo = $('#ContentPlaceHolder1_Cbm_Periodo').val();
            var carrera = $('#ContentPlaceHolder1_cbm_Carreras').val();
            $.ajax({
                type: "POST",
                url: "ajax.aspx/Obtener_Paralelo",
                data: "{_idCarrera:"+carrera+",_idPeriodo:"+periodo+"}",
                dataType: "json",
                contentType: "application/json; charset=utf-8",
                success: function (response) {
                    var paralelo = (typeof response.d) == 'string' ? eval('(' + response.d + ')') : response.d;
                    //alert(contactos.length);

                    for (var i = 0; i < paralelo.length; i++) {
                        $('#ContentPlaceHolder1_cbmParalelo').append(
                                              '<option value="' + paralelo[i].idParalelo + '">' + paralelo[i].ParaleloNombre + '</option>'
                                            );
                    }
                },
                error: function (response) {

                    alert('ERROR ' + response.status + ' ' + response.statusText);
                }

            });

        }
    </script>


    <form id="Form1" runat="server">

                <div class="row">
                  <div class="col-md-3 col-sm-12 col-xs-12">
                        <div class="portlet portlet-default panel panel-primary text-center">
                            <div class="portlet-body">
                                <i class="fa fa-edit fa-3x"></i>
                            </div>
                            <asp:Button ID="Btn_Ingreso_Asignacion" runat="server" cssClass="btn btn-default btn-lg" Text="Ingresar" Width="229px" Height="40px" />
                        </div>
                    </div>
                    <div class="col-md-3 col-sm-12 col-xs-12">
                        <div class="portlet portlet-default panel panel-primary text-center">
                            <div class="portlet-body">
                                <i class="fa fa-eye fa-3x"></i>
                            </div>
                            <asp:Button ID="Btn_Consulta_Asignacion" runat="server" cssClass="btn btn-default btn-lg" Text="Consultar" Width="229px" Height="40px" />
                        </div>
                    </div>
                    <div class="col-md-3 col-sm-12 col-xs-12">
                        <div class="portlet portlet-default panel panel-primary text-center">
                            <div class="portlet-body">
                                <i class="fa fa-eraser fa-3x"></i>
                            </div>
                            <asp:Button ID="Btn_ELiminar_Asignacion" runat="server" cssClass="btn btn-default btn-lg" Text="Eliminar" Width="229px" Height="40px" />
                        </div>
                    </div>
                </div>


                <!-- /. ROW  -->

                <div class="row">
                    <div class="col-md-8 col-sm-12 col-xs-12">

                        <div class="panel panel-default">
                            <div class="auto-style3">
                                Asignación de Materias</div> 
                            <div class="panel-body">
                                <div class="table-responsive">



                                    <table class="table table-striped table-bordered table-hover">
                                        <thead>
                                           
                                        </thead>
                                        <tbody>
                                            <tr>
                                                <td class="auto-style5">Periodo:</td>
                                                <td>
                                                    <asp:DropDownList ID="Cbm_Periodo" runat="server" ValidateRequestMode="Enabled">
                                                        <asp:ListItem>Escoja una opcion</asp:ListItem>
                                                    </asp:DropDownList>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="auto-style5">Carrera:</td>
                                                <td>
                                                    <asp:DropDownList ID="cbm_Carreras" runat="server" ValidateRequestMode="Enabled">
                                                    </asp:DropDownList>
                                                </td>
                                            </tr>

                                                 <tr>
                                                <td class="auto-style5">Paralelo</td>
                                                <td>
                                                    <asp:DropDownList ID="cbmParalelo" runat="server" ValidateRequestMode="Enabled">
                                                    </asp:DropDownList>
                                                </td>
                                            </tr>

                                        </tbody>
                                    </table>
                                <div class="auto-style2">


                                    <table class="table table-striped table-bordered table-hover">
                                        <thead>
                                            <tr>
                                                <th>Materia</th>
                                                <th class="auto-style4">Docente</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr>
                                                <td class="auto-style1">
                                                    <asp:DropDownList ID="cbmMateria" runat="server" ValidateRequestMode="Enabled">
                                                    </asp:DropDownList>
                                                </td>
                                                <td class="auto-style4">
                                                    <asp:DropDownList ID="cbmDocente" runat="server" ValidateRequestMode="Enabled">
                                                    </asp:DropDownList>
                                                </td>
                                            </tr>

                                        </tbody>
                                    </table>

                                    <asp:Button ID="Btn_Guardar_Asignacion" runat="server" cssClass="btn btn-default btn-lg" Text="Guardar" Width="229px" Height="40px" />
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- /. ROW  -->
        </form>
</asp:Content>

